/*
** ############################################################################
**     Project   : osdee - Operative Systems Design for Embedded Envrionments
**     File      : Gpt_Cfg.h
**     Revision  ; 1.0
**     Abstract  :
**         GPT Configuration Interface.
**         Definition of the GPT Configuration elements
**     Processor : MC9S12XEP100CVL
**     Version   : Component 01.042, Driver 01.05, CPU db: 3.00.036
**     Datasheet : MC9S12XEP100 Rev. 1.19 12/2008
**
**     Copyright : 2014 Fernando Rodriguez, Open source with out any responsability.
**     
**     mail      : frr@gmail.com
** ############################################################################
*/

#ifndef _GPT_CFG_H_
#define _GPT_CFG_H_

#include "cdef.h"
#include "pit.h"
//#include "Os_TaskM.h"

/*
** ===================================================================
**     Type        :  tsGPT_Channel_Cfg
**
**     Description :
**         Specific PIT Channel Configuration.
**         - tChannel     : Atomic PIT Channel information (see pit.h).
**         - boInitialize : If TRUE, channel will be initialized.
**         - boStart      : If TRUE, channel will be started (countdown).
**         - boEnabled    : If TRUE, channel interrupts will be enabled.
**
**     Note               :
**         In order to have a complete Timmer working Initialize, the parameters:
**         Start and Enable should be set to true. 
** ===================================================================
*/
typedef struct 
{
  tsPIT_Channel tChannel;
  BOOL boInitialize;
  BOOL boStart;
  BOOL boEnabled;  
} tsGPT_Channel_Cfg;

/*
** ===================================================================
**     Type        :  tsGPT_Configuration
**
**     Description :
**         Contains all the GPT Configuration.
**         - atChannels   : List of available channels.
**         - boLoad_GPT_Configuration : If TRUE, GPT configuration will be loaded,
**                                      otherwise no action will be taken.
** ===================================================================
*/
typedef struct 
{
  BOOL boLoad_GPT_Configuration;
  tsGPT_Channel_Cfg atChannels[PIT_SUPPORTED_CHANNELS];  
}tsGPT_Configuration;

/*
** ===================================================================
**     Type        :  tsGPT_Configuration
**
**     Description :
**         Stores GPT Configuration.
** ===================================================================
*/
extern tsGPT_Configuration mal_mcu_tGPT_configuration;

/*
** ===================================================================
**     Function    :  Mcu_GPT_ChannelX_Callback
**
**     Description :
**         GPT Channels callbacks prototypes.
** ===================================================================
*/
void Mcu_GPT_Channel0_Callback(void);
void Mcu_GPT_Channel1_Callback(void);
void Mcu_GPT_Channel2_Callback(void);
void Mcu_GPT_Channel3_Callback(void);
void Mcu_GPT_Channel4_Callback(void);
void Mcu_GPT_Channel5_Callback(void);
void Mcu_GPT_Channel6_Callback(void);
void Mcu_GPT_Channel7_Callback(void);

#endif /*_GPT_CFG_H_*/